import {
  SystemZeroCodeAutomationSaveJson,
  SystemZeroCodeAutomationPublicJson,
  SystemZeroCodeAutomationFindById,
  SystemZeroCodeAutomationTable,
  SystemZeroCodeAutomationIsFreeze,
} from "@/services/api";
import { request, METHOD } from "@/utils/request";

/**
 * 保存
 */
export async function automationSave(form) {
  return request(SystemZeroCodeAutomationSaveJson, METHOD.POST, form);
}
/**
 * 发布
 */
export async function automationPublic(form) {
  return request(SystemZeroCodeAutomationPublicJson, METHOD.POST, form);
}

/**
 * 根据Id获取
 */
export async function findById(id) {
  return request(SystemZeroCodeAutomationFindById + "/" + id, METHOD.GET, {});
}
/**
 * 获取工作表
 */
export async function table(form) {
  return request(SystemZeroCodeAutomationTable, METHOD.POST, form);
}
/**
 *
 */
export function isFreeze(param) {
  return request(SystemZeroCodeAutomationIsFreeze, METHOD.POST, param);
}
export default {
  automationSave,
  automationPublic,
  findById,
  table,
  isFreeze,
};
